import {getLatestMonthsMilliseconds} from "../../../js/dateUtils";

const dict = {
  productSources: [
    {value: "1688", label:"1688"},
    {value: "淘宝", label:"淘宝"},
    {value: "pdd", label:"拼多多"},
    {value: "aliexpress", label:"aliexpress"},
    {value: "alibaba", label:"alibaba"},
    {value: "weidian", label:"微店"},
  ],
  productStates: [
    {value: 1, label: "未审核"},
    {value: 2, label: "审核中"},
    {value: 3, label: "已审核"},
    // {value: 4, label: "已屏蔽"},
  ],
  importStates: [
    {value: -1, label: "未导入"},
    {value: 0, label: "已加入导入队列"},
    {value: 1, label: "正在导入"},
    // {value: 2, label: "正在导入图片"},
    {value: 3, label: "数据导入失败"},
    {value: 4, label: "图片导入失败"},
    {value: 5, label: "导入成功"},
  ],
  stateNew: 1,
  stateAuditing: 2,
  stateAudited: 3,
  datePickerOptions: {
    shortcuts: [
      {
        text: '近三天',
        value () {
          const end = new Date();
          const start = new Date();
          start.setTime(start.getTime() - 3600 * 1000 * 24 * 2);
          return [start, end];
        }
      },
      {
        text: '近一周',
        value () {
          const end = new Date();
          const start = new Date();
          start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
          return [start, end];
        }
      },
      {
        text: '近一个月',
        value () {
          const end = new Date();
          const start = new Date();
          let millSeconds = getLatestMonthsMilliseconds(1, start);
          start.setTime(start.getTime() - millSeconds);
          return [start, end];
        }
      },
      /*{
        text: '近三个月',
        value () {
          const end = new Date();
          const start = new Date();
          start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
          return [start, end];
        }
      }*/
    ]
  },
  priceUnits: [
    {value: "piece", label:"件"},
    {value: "pair", label: "对"},
    {value: "set", label: "套"},
    {value: "pack", label: "包"},
    {value: "dozen", label: "打"},
  ],
  tagList: ["特殊", "电或磁", "美妆", "种子", "笔类"],
  brands: [
    "Balenciaga", "Celine", "Chanel", "Dior", "Fendi", "Gucci", "Hermes", "Louis Vuitton", "Nike", "Prada",
    "Tory Burch", "Versace", "YSL", "Burberry", "Bottega Veneta", "Loewe", "Valentino", "Goyard", "Ferragamo",
    "Adidas", "Champion", "Supreme"
  ],
  siteCodes: [
    {value: 99, label:"Fake"},
    {value: 199, label: "shereps"}

  ]
};

let status = {
  modifyModal: {
    isShow: false,
    tagList: [],
    defaultTagList: dict.tagList,
    brandList: [],
    defaultBrandList: dict.brands,
  },
  modifyColorModal: {
    isShow: false,
    colorIndex: 0,
  },
  imageSelectModal: {
    isShow: false,
    type: 0,
  },
  banModal: {
    isShow: false,
  },
};

let page = {
  listPage: {
    total: 0,
    pageNum: 1,
    pageSize: 40,
    options: [40, 60, 80, 120],
  }
}

let data = {
  list: [],
}

let params = {
  searchParam: {
    categories: [],
    from: null,
    state: 1,
    tag: null,
    startTime: null,
    endTime: null,
    hasBanned: 0,
    shopId: "",
    pCode: "",
    author: "",
    isAuditable: true,
    sourceUrl: "",
    siteCode:199,
    titleEn:''
  },
  modifyParam: {
    id: "",
    createTime: 0,
    from: "",
    author: "",
    sourceUrl: "",
    otherSourceUrls: [],
    categories: [],
    pCode: "",
    title: "",
    titleEn: "",
    weight: null,
    priceUnit: "",
    // hasSizeTable: false,
    sizeTable: [],
    prices: [],
    shippingFee: 0,
    mainImgs: [],
    colors: [],
    attrs: [],
    productImgs: [],
    tags: [],
    state: 0,
    auditInfo: {
      auditTime: null,
      employeeId: "",
      employeeName: "",
      desc: "",
    },
    hasBanned: false,
    extra: "",
    gender: "",
    videos:[]
  },
  colorParam: {
    name: "",
    nameEn: "",
    colorImg: "",
    position: 0,
    imgOriginal: "",
    sizes: [],
    detailImgs: [],
  },
  tagsParam: {
    id: "",
    tags: [],
  },
  banParam: {
    ids: [],
    reason: "",
  },
}

export default {
  dict: dict,
  tStatus: status,
  tPage: page,
  tData: data,
  tParam: params,
}
